package com.hqx.shiro.controller;


import com.hqx.shiro.base.BaseResult;
import com.hqx.shiro.util.ShiroUtils;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author PH
 * @since 2019-07-25
 */
@Controller
@RequestMapping("/user")
public class UserController {


    @RequestMapping("/index")
    @ResponseBody
    public BaseResult index(){
        String userId = ShiroUtils.getUserId();
        List<String> list = new ArrayList<>();
        list.add("这是首页的内容");
        list.add("内容2");
        list.add("内容3");
        list.add(userId);
        list.add("内容4");
        list.add("内容5");
        list.add("内容6");
        return BaseResult.success(list);

    }
}

